package com.bci.pwtz.mysql.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.bci.pwtz.mysql.model.CompanyUserRole;

public interface CompanyUserRoleMapper {
    int deleteByPrimaryKey(Long refId);

    int insert(CompanyUserRole record);

    int insertSelective(CompanyUserRole record);

    CompanyUserRole selectByPrimaryKey(Long refId);

    int updateByPrimaryKeySelective(CompanyUserRole record);

    int updateByPrimaryKey(CompanyUserRole record);
    
    int selectCountByUserIdAndCompanyId(@Param("companyUserId") Long companyUserId,@Param("companyRoleId") Long companyRoleId);
    
    int deleteCompanyUserRoleByUserId(@Param("companyUserId") Long companyUserId,@Param("companyRoleId") Long companyRoleId);
    
    int selectCountByCompanyRoleId(@Param("companyRoleId")Long companyRoleId);
    
    int deleteByCompanyRoleId(@Param("companyRoleId")Long companyRoleId);
    
    int clearUserRoleRefByCompanyId(@Param("companyUserId")Long companyUserId,@Param("companyId")Long companyId);
    
    List<CompanyUserRole> selectRoleByUserId(@Param("userid")Long userid);
    
    List<CompanyUserRole> selectCompanyUserRole(@Param("companyId")long companyId,@Param("userId")long userId);
    
    List<CompanyUserRole> selectUserId(@Param("companyRoleId") long companyRoleId);
}